import pygame
import sys
from pygame.locals import *


pygame.init()
pygame.display.set_caption('Paint')
screen = pygame.display.set_mode((640,480))
screen.fill((255,255,255))
i = 100
t = 100
move_down = False
def draw(i,t):
	screen.fill((120,0,120))
	
	font = pygame.font.Font(None, 100)
	text = font.render('snake', True, (255,0, 0), (159, 182, 205))
	screen.blit(text, (70,140))

	pygame.draw.rect(screen,(0,0,255),Rect(100, 100, 100, 90),)
	
	
	pygame.display.update()
			
			
while True:	
	for event in pygame.event.get():
#		print ( 'event.type = ' + str(event.type) )
		if event.type == KEYDOWN:
			try:
				print ( 'event.key (char) = ' + chr(event.key)  + ', event.key (number) ' + str( event.key ) )
			except:
				print ( 'event.key (number) ' + str( event.key ) )
			if event.key == ord('q'):
				sys.exit()
			if event.key == 274 :
				move_down = True
			
	if ( move_down ):
		t = t + 1			
	else:
		i = i + 1 
	draw(i,t)	
		
